<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <h1>The AJAX 01 Page</h1>
    <fieldset>
    <lengen>Ajax 异步Get请求</lengen>
    <button onclick="doAjaxGet01()">Ajax Get Requset</button>
    <span id="result">Data is Loading...</span>
    </fieldset>
    <script>
        function doAjaxGet01() {
            let xhr = new XMLHttpRequest();
            xhr.onreadystatechange=function () {
                if (xhr.readyState==4&&xhr.status==200){
                    document.getElementById("result").innerHTML=xhr.responseText;
                }
            }
            xhr.open("GET","http://localhost:8080/doAjaxAGet01",true);
            xhr.send(null);
            console.log("===main tread===")
        }
    </script>
</body>
</html>